package practice;
/*
题目：两个乒乓球队进行比赛，各出三人。
甲队为a,b,c三人，乙队为x,y,z三人。
已抽签决定比赛名单。有人向队员打听比赛的名单。
a说他不和x比，c说他不和x,z比，请编程序找出三队赛手的名单。
 */
public class practice18 {

    public static void main(String[] args) {
        String[] team1 = {"a", "b", "c"};
        String[] team2 = {"x", "y", "z"};
        for (int i = 0; i < team2.length; i++) {
            for (int j = 0; j < team2.length; j++) {
              if (i != j) {
                  for (int k = 0; k < team2.length; k++) {
                      if (i != 0 && k != 0 && k != 2) {
                          if (i != k && j != k) {
                              System.out.println(team1[0] + "-" + team2[i]);
                              System.out.println(team1[1] + "-" + team2[j]);
                              System.out.println(team1[2] + "-" + team2[k]);
                          }
                      }
                  }
              }
            }
        }
    }

}
